import Vue from 'vue'
export default {
  //必须有一个参数state
  // setMusic(state){
  //     state.nowMusic 
  // },
  //设置音乐进度
  clickSetProgress(state) {
    document.getElementsByTagName("audio")[0].currentTime = document.getElementsByTagName("audio")[0].duration * (state.progress / 100)
  },
  getProgress(state) {
    state.progress = (document.getElementsByTagName("audio")[0].currentTime / document.getElementsByTagName("audio")[0].duration) * 100;
    state.nowTime = document.getElementsByTagName("audio")[0].currentTime
  },
  //save歌词
  saveLyric(state, str) {
    state.lyric = str
  },
  //存储歌曲评论
  saveComment(state, obj) {
    state.songcomment = obj
  },
  //个人收藏歌单存储
  savePersonalPlaylist(state, arr) {
    state.personalPlaylist = arr
  },
  //歌单列表存储
  saveSongList(state, arr) {
    state.songList = arr
  },
  //标签对应全部存储
  saveSongAllList(state, arr) {
    state.songAllList = arr
  },
  //标签名
  saveTagName(state, str) {
    state.tagName = str
  },
  //改变歌手选择器标识
  tabFlag(state, obj) {
    if (obj.languageFlag) {
      state.languageFlag = obj.languageFlag
    }
    if (obj.areaFlag) {
      state.areaFlag = obj.areaFlag
    }
    if (obj.filtrateFlag) {
      state.filtrateFlag = obj.filtrateFlag
    }
  },
  //新碟标志
  saveDisc(state, str){
    state.flag = str
  }
}
